/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package salaryslip;

/**
 *
 * @author Lynx
 */
import javax.swing.*;
import java.awt.*;
import java.*;
import java.util.Scanner;
import java.util.Date;
import sun.text.resources.BreakIteratorInfo_th;
        
public class SalarySlip 
{
    private static double tax;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) 
    {
       Scanner input = new Scanner(System.in);
       double TAX = 0.14;
       
       int staffNumber;
       String surname;
       double grossSalary;
       String choice ;
       String line;
       double incomTax = 0.0;
       double medicalAid = 0.0;
       double pensinFund = 0.0;
       double uif = 0.0;
       double netSal = 0.0;
       
       System.out.print("Enter staff number: ");
       staffNumber = input.nextInt();
       System.out.print("Enter surname: ");
       surname = input.next();
       System.out.print("Enter gross salary: R ");
       grossSalary = input.nextDouble();
       
       System.out.print("Enter your memebership: ");
      choice = input.next();
       //line = input.nextLine();
       //choice = input.findInLine(" . ").charAt(0);
     
            if( (!"P".equalsIgnoreCase(choice)) && (!"F".equalsIgnoreCase(choice)))
            {
                System.out.println("Make sure your memebership is between Part time or Full time");
                System.out.println("Enter the F or P");
                choice = input.next();
            }
            else
            {
                if("P".equalsIgnoreCase(choice) )
                {
                    choice = "Part time";
                    incomTax = grossSalary * 0.15;
                    uif = grossSalary * 0.2;

                    System.out.println("...............PART TIME.............");
                    System.out.printf(" Stuff number %d\n"
                                      + " Surname: %s\n"
                                      + " Gross Salary R %.2f\n"
                                      + " Membership: %s\n"
                                      + " Income Tax: R %.2f\nUIF R %.2f\n", 
                                      staffNumber, surname, grossSalary, choice, incomTax, uif);

                }
                else
                     if( "F".equalsIgnoreCase(choice) && grossSalary > 10.000)
                      {
                          choice = "Full Time";
                           incomTax = grossSalary * 0.2;
                           medicalAid = grossSalary * 0.025;
                           pensinFund = grossSalary * 0.1;
                           netSal = grossSalary - incomTax - medicalAid - pensinFund;

                           System.out.println("...........FULL TIME.................");
                               System.out.printf(" Stuff number %d\n"
                                                 + " Surname: %s\n"
                                                 + " Gross Salary R %.2f\n"
                                                 + " Membership: %s\n"
                                                 + " Income Tax: R %.2f\n"
                                                 + " Medical Aid Fund: R %.2f\n"
                                                 + " Pension Pension Fund: R %.2f\n"
                                                 + " Net Salary R %.2f\n", 
                                                 staffNumber, surname, grossSalary, choice, incomTax, medicalAid,pensinFund,  netSal);

                       }
                        else
                        {
                           choice = "Full Time";
                            incomTax = grossSalary * 0.14;
                            medicalAid = grossSalary * 0.025;
                            pensinFund = grossSalary * 0.1;
                            netSal = grossSalary - incomTax - medicalAid - pensinFund;

                            System.out.println("...........FULL TIME.................");
                                System.out.printf(" Stuff number %d\n"
                                                  + " Surname: %s\n"
                                                  + " Gross Salary R %.2f\n"
                                                  + " Membership: %s\n"
                                                  + " Income Tax: R %.2f\n"
                                                  + " Medical Aid Fund: R %.2f\n"
                                                  + " Pension Pension Fund: R %.2f\n"
                                                  + " Net Salary R %.2f\n", 
                                                  staffNumber, surname, grossSalary, choice, incomTax, medicalAid,pensinFund,  netSal);


                       }
            }
       }
    
}
